#include <stdlib.h>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "event.hpp"
#include "menu.hpp"

inline unsigned int getCoolVideoMode(void)
{
  unsigned int VideoModesCount = sf::VideoMode::GetModesCount();
  for (unsigned int i = 0; i < VideoModesCount; ++i)
    {
      sf::VideoMode Mode = sf::VideoMode::GetMode(i);
      if (Mode.IsValid())
	return (VideoModesCount);
      // Mode is a valid video mode
    }
}

/*
 to make window full screen

App.create(sf::VideoMode(1024, 768, 32), "violated", sf::Style::Fullscreen);

but only a few video mode is supported in fullscreen...
for get a supported videomode make :
getCoolVideoMode();
or 
sf::VideoMode DesktopMode = sf::VideoMode::GetDesktopMode();
to get the currend desktop videomode
*/

int main()
{
  sf::RenderWindow App(sf::VideoMode(1000, 750, 32), "violated");
  violated::eventManager E(&App);
  violated::menu M(&App, &E);

  while (E.isRuning())
    {
      App.Clear();
      E.action();
      App.SetActive();
      M.execMenu();
      App.Display();
      
    }
  return (EXIT_SUCCESS);
}
